package com.fa4j.product.category.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fa4j.common.base.model.CommonState;
import com.fa4j.common.base.model.Tree;
import com.fa4j.common.data.model.Base;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

/**
 * 实体-商品分类
 *
 * @since 2025-11-22 21:06:24
 */
@Data
@TableName(value = "t_product_category", autoResultMap = true)
@Schema(description = "商品分类")
public class Category extends Base implements Tree<Integer, Category> {

    @TableId(type = IdType.AUTO)
    @Schema(description = "主键")
    private Integer id;

    @Schema(description = "分类名称")
    private String name;

    @Schema(description = "分类图片ID")
    private Long imgId;

    @TableField(exist = false)
    @Schema(description = "分类图片url")
    private String imgUrl;

    @Schema(description = "状态")
    private CommonState state;

    @Schema(description = "上级ID")
    private Integer parentId;

    @Schema(description = "优先级")
    private Integer priority;

    @TableField(exist = false)
    @Schema(description = "下级分类")
    private List<Category> children;

    @TableField(exist = false)
    @Schema(description = "商品分类属性列表")
    private List<CategoryAttribute> attrList;

    @Schema(description = "操作人ID")
    private Long operatorId;

}
